// This file is part of OpenTSDB.
// Copyright (C) 2017 TeleDB Development Group.
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 2.1 of the License, or (at your
// option) any later version.  This program is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
// General Public License for more details.  You should have received a copy
// of the GNU Lesser General Public License along with this program.  If not,
// see <http://www.gnu.org/licenses/>.
package net.opentsdb.tsd.points;

public class PutConfig {

    public PutConfig(){}

    private String forward;
    private Boolean showDetails;
    private Boolean showSummary;
    private Boolean isSynchronous;
    private int syncTimeout;

    public static Builder newPutConfig() {
        return new Builder();
    }

    public static final class Builder {
        private String forward;
        private Boolean showDetails;
        private Boolean showSummary;
        private Boolean isSynchronous;
        private int syncTimeout;

        private Builder() {
        }

        public Builder withForward(String forward) {
            this.forward = forward;
            return this;
        }

        public Builder withShowDetails(Boolean showDetails) {
            this.showDetails = showDetails;
            return this;
        }

        public Builder withShowSummary(Boolean showSummary) {
            this.showSummary = showSummary;
            return this;
        }

        public Builder withSyncTimeout(int syncTimeout) {
            this.syncTimeout = syncTimeout;
            return this;
        }

        public Builder withSynchronous(Boolean isSynchronous) {
            this.isSynchronous = isSynchronous;
            return this;
        }

        public PutConfig build() {
            PutConfig putConfig = new PutConfig();
            putConfig.setForward(forward);
            putConfig.setShowDetails(showDetails);
            putConfig.setShowSummary(showSummary);
            putConfig.setSyncTimeout(syncTimeout);
            return putConfig;
        }
    }

    public String getForward() {
        return forward;
    }

    public void setForward(String forward) {
        this.forward = forward;
    }

    public Boolean getShowDetails() {
        return showDetails;
    }

    public void setShowDetails(Boolean showDetails) {
        this.showDetails = showDetails;
    }

    public Boolean getShowSummary() {
        return showSummary;
    }

    public void setShowSummary(Boolean showSummary) {
        this.showSummary = showSummary;
    }

    public Boolean getSynchronous() {
        return isSynchronous;
    }

    public void setSynchronous(Boolean synchronous) {
        isSynchronous = synchronous;
    }

    public int getSyncTimeout() {
        return syncTimeout;
    }

    public void setSyncTimeout(int syncTimeout) {
        this.syncTimeout = syncTimeout;
    }
}
